package com.thexb.sys.controller;

import com.thexb.common.Result;
import com.thexb.sys.entity.Menu;
import com.thexb.sys.service.IMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author thexb
 * @since 2023-04-04
 */
@RestController
@RequestMapping("/menu")
public class MenuController {
    @Autowired
    IMenuService iMenuService;

    @GetMapping("/list")
    public Result<List<Menu>> list() {
        List<Menu> list = iMenuService.getAllMenu();
        return Result.success(list);
    }
}
